<template>
  <div class="member-home">
    <!-- 个人中心 -->

    <home-overview></home-overview>

    <home-panel title="我的足迹">
      <goods-item :goods="goods" v-for="i in 4" :key="i"></goods-item>
    </home-panel>

    <home-panel title="我的收藏">
      <goods-item :goods="item" v-for="item in collectGoods" :key="item.id"></goods-item>
    </home-panel>

    <goods-relevant></goods-relevant>

  </div>
</template>

<script>
import HomeOverview from '@/views/member/home/components/home-overview'
import HomePanel from '@/views/member/home/components/home-panel'
import GoodsRelevant from '@/views/goods/components/goods-relevant'
import GoodsItem from '@/views/category/components/goods-item'
import { findCollect } from '@/api/index.js'
import { ref } from 'vue'
export default {
  name: 'member-home',

  components: {
    HomeOverview,
    HomePanel,
    GoodsRelevant,
    GoodsItem
  },

  setup () {
    const goods = {
      id: '1',
      name: '自煮火锅不排队 麦饭石不粘鸳鸯火锅',
      picture: 'https://yanxuan-item.nosdn.127.net/fcdcb840a0f5dd754bb8fd2157579012.jpg',
      desc: '清汤鲜香 红汤劲爽',
      price: '159.00'
    }

    const collectGoods = ref([])

    findCollect({ page: 1, pageSize: 4 }).then(data => {
      collectGoods.value = data.result.items
    })
    return { goods, collectGoods }
  }

}
</script>

<style lang="less" scoped>
:deep(.xtx-carousel) .carousel-btn.prev {
  left: 5px;
}
:deep(.xtx-carousel) .carousel-btn.next {
  right: 5px;
}
</style>
